package com.itheima.wemedia.feign;

import com.itheima.common.vo.ResultVo;
import com.itheima.wemedia.pojo.WmUser;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;

/**
 * @version 1.0
 * @description 说明
 * @package com.itheima.media.feign
 * contextId: spring容器中的bean对象id
 */
@FeignClient(name = "leadnews-wemedia", contextId = "wmUserFeign")
public interface WmUserFeign {

    /**
     * 远程调用添加自媒体账号
     * @param wmUser
     * @return
     */
    @PostMapping("/api/wmUser/add")
    ResultVo<WmUser> add(@RequestBody WmUser wmUser);

    /**
     * 通appUserId查询自媒体账号信息
     * @param appUserId
     * @return
     */
    @GetMapping("/api/wmUser/{appUserId}")
    ResultVo<WmUser> getByAppUserId(@PathVariable(name = "appUserId") Integer appUserId);
}
